#!/usr/bin/env python
#-*- coding: utf-8 -*-


class Term(object):
    '''
    Language neutral term.
    
    Stores references to specific language definition objects and tag objects.
    '''

    def __init__(self, term_id):
        self.id = term_id
        self.definitions = [] # stores LanguageDefinition objects
        self.tags = [] # stores tag objects
        

class Language(object):
    '''A specific language, an idiom.'''

    def __init__(self, name, lang_code, flag_url):
        self.name = name
        self.lang_code = lang_code
        self.flag = flag_url # link to country flag image
        self.references = [] # stores urls for online language references


class LanguageDefinition(object):
    '''
    Defines a term in a specific language.
    
    Stores descriptions as well as references to synonym and derivations terms.
    '''

    def __init__(self, language_object):
        self.language = language_object
        self.synonyms = [] # stores term objects
        self.derivations = [] # stores term objects
        self.descriptions = [] # stores description strings
        
    def set_definition(self, article, content, plural):
        self.article = article
        self.content = content
        self.plural = plural


class Tag(object):
    '''
    Classifies a term under a label.
    
    Stores description texts and images as well as references to subtags.
    '''

    def __init__(self, term_id):
        self.term_id = term_id
        self.texts = []
        self.images = []
        self.subtags = [] # stores tag objects

